<!--# layout("/common/layout.html",{"jsBase":"/js/promote/promoteConfig/"}){ -->
<br>
<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="tenantId" id="tenantId">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px">结算周期</label>
				<div class="layui-input-inline">
                                <input type="text" name="settlementCycle" id="settlementCycle" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|number" style="width:350px;">
				</div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px">押金比例</label>
				<div class="layui-input-inline">
                                <input type="text" placeholder="百分比，比如20表示20%" name="depositRatio" id="depositRatio" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|number" style="width:350px;">
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px">结算截止日</label>
				<div class="layui-input-inline">
                        <input type="text" placeholder="比如901，指每年9月1日结算去年的帐，包括押金" name="settlementDate" id="settlementDate" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|number" style="width:350px;">
				</div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label" style="width: 150px">每日提现额度(分)</label>
				<div class="layui-input-inline">
                                <input type="text" name="withdrawLimit" id="withdrawLimit" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|number" style="width:350px;">
				</div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 150px">APPID</label>
                <div class="layui-input-inline">
                    <input type="text" name="wxAppid" id="wxAppid" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required" style="width:350px;">
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 150px">商户ID</label>
                <div class="layui-input-inline">
                    <input type="text" name="wxMerchantId" id="wxMerchantId" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required" style="width:350px;">
                </div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.extend({
    loading: '../../../plugins/layui_extends/loading/loading',
}).define([ 'form', 'laydate', 'table','loading','promoteConfigApi'], function(exports) {
    var form = layui.form;
    var promoteConfigApi = layui.promoteConfigApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(promoteConfigJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                // $("#addButton").hide();
                // $("#addButton-loading").show();
                // $("#addButton-loading").loading();
                form.on('submit(form)', function(){
                    promoteConfigApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(promoteConfigJson))){  -->
    var formJson = ${promoteConfigJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
